<%@ page  contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="page" uri="http://www.forten.org/taglib/page"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- CSS -->
<link type="text/css" rel="stylesheet" href="../styles/css/reset.css">
<link type="text/css" rel="stylesheet" href="../styles/css/index.css">
<link type="text/css" rel="stylesheet" href="../styles/css/button.css">
<script type="text/javascript" src="../scripts/html5.js"></script>
<script type="text/javascript" src="../scripts/jquery-1.6.min.js"></script>
<!-- end -->
<title>考勤信息发送</title>
<style type="text/css">
.left-main{
  margin:0px;
  padding:0px;
  overflow:auto;
  overflow-x:hidden;
     }
</style>
</head>
<script type="text/javascript">

function doSendMsg(){
	var length = $("input[name='id']:checked").length;
	if(length == 0){
		alert("请选择需要发送考勤短信的人员");
	} else {
		$('#btn').val('短信发送中...');
		$('#btn').attr('disabled',true);
		$('#frm').submit();
		/* $.ajax({
			type:'post',
			url:'/selectcourse/sendCheckInShortMsg.jspx',
			success:function(data){
				alert(data);
			}
		}); */
	}
}

$(function() {
	$("#checkAll").click(function() {
		$('input[name="id"]').attr("checked",this.checked);
	});
	var $id = $("input[name='id']");
	$id.click(function(){
		$("#checkAll").attr("checked",$id.length == $("input[name='id']:checked").length ? true : false);
	});
});
</script>
<body>
<c:if test="${! empty message}">

		<script >
			 var message = "${message}";
			 alert(message);
		 }
		</script>
</c:if>
	<header>
	<div class="headerWrap"></div>
	</header>

 <div class="content">
		<section>
	<div class="rc_info mt20">
		<h3>
			<span class="r_title_ico"></span>课程相关信息
		</h3>
    </div>
    <table class="rc_tab01" cellspacing="0" cellpadding="0">
    	<tbody>
    		<tr>
    			<th style="text-align: center;width: 20%">课程名</th>
    			<th style="text-align: center;width: 20%">授课教师</th>
    			<th style="text-align: center;width: 25%">上课时间</th>
    			<th style="text-align: center;">上课地点</th>
    		</tr>
    		<tr>
    			<td style="text-align: center;">${courseDto.name }</td>
    			<td style="text-align: center;">${courseDto.teacherName }</td>
    			<td style="text-align: center;"><fmt:formatDate
								value="${courseDto.teachTime }" pattern="yyyy年MM月dd日HH点mm分" /></td>
				<td style="text-align: center;">${courseDto.classroom }</td>
    		</tr>
    	</tbody>
    </table>
   		<div class="rc_info mt20">
			<h3>
				<span class="r_title_ico"></span>该课程选课人员名单
			</h3>
		</div>
  <form action="sendCheckInShortMsg.jspx"  method="post" name="frm" id="frm" onsubmit="document.getElementById('btn').value='发送中 请稍候';document.getElementById('btn').disabled=true;">
  <div style="max-height: 400px;width: 978px;" class="left-main">
  <table class="rc_tab01" cellspacing="0" cellpadding="0">
    	<tbody>
    		<tr>
    			<th style="width: 10%">
    			<input id="checkAll" type="checkbox" name="checkAll">
    			全选
    			</th>
    			<th style="width: 15%">姓名</th>
    			<th style="width: 20%">手机号</th>
    			<th>电子邮箱</th>
    		</tr>
    		<c:forEach items="${csDto}" var="dto" varStatus="s">
    		<tr>
    		<td>
    		<input type="checkbox" id="${s.index }" value="${dto.cadreDto.id }" name="id" />
    		${s.index+1}
    		</td>
    		<td>${dto.cadreDto.name }</td>
    		<td>${dto.cadreDto.mobileNum }</td>
    		<td>${dto.cadreDto.email }</td>
    		</tr>
    		</c:forEach>
    	</tbody>
  </table>
  </div>
  		<div class="rc_info mt20">
			<h3>
				<span class="r_title_ico"></span>考勤短信模板编辑
			</h3>
		</div>
  <table>
  	<tbody>
		<tr>
			<td>
				<textarea rows="5" cols="130" name="msg" id="msg">${msg }</textarea>
			</td>
		</tr>  	
  	</tbody>
  </table>
  
  <div style="text-align: right;">
    <input id="btn" type="button" value="发送" class="button" onclick="doSendMsg();"/>
  </div>
  
  </form>
  	
  </section>
 </div> 
  
<%@include file="/common/foot.jsp"%>